package net.cellkyborg.RSInstances;

public class RSObject {
	
	public RSObject() {
	}
	
	private transient int absX = -1, absY = -1, heightLevel = -1;
	private transient int currentX = -1, currentY = -1;
	private transient int mapRegionX = -1, mapRegionY = -1;
	public int[] location = { absX, absY, heightLevel };
	public int[] currentLocation = { currentX, currentY };
	public int[] mapRegion = { mapRegionX, mapRegionY };
	
	public int[] getLocation() {
		return location;
	}
	
	public void setLocation(int absX, int absY, int heightLevel) {
		location[0] = absX;
		location[1] = absY;
		location[2] = heightLevel;
	}
	
	public int[] getCurrentLocation() {
		return currentLocation;
	}
	
	public void setCurrentLocation(int absX, int absY) {
		currentLocation[0] = absX;
		currentLocation[1] = absY;
	}
	
	public int[] getMapRegion() {
		return mapRegion;
	}
	
	public void setMapRegion(int mapRegionX, int mapRegionY) {
		mapRegion[0] = mapRegionX;
		mapRegion[1] = mapRegionY;
	}
	
	public boolean isInAreaDistance(RSObject rso) {
		if(heightLevel != rso.heightLevel) return false;
		int deltaX = rso.absX-absX, deltaY = rso.absY-absY;
		return deltaX <= 15 && deltaX >= -16 && deltaY <= 15 && deltaY >= -16;
	}
}
